<template>
  <div class="adaptation">
    <cpro-public title="需要支持/适配的客户端（支持多选）">
      <template v-slot:content>
        <el-checkbox-group v-model="watchCheckBox">
          <template v-for="(item, index) in chooses" :key="index">
            <el-checkbox :label="item">{{ item }}</el-checkbox>
          </template>
        </el-checkbox-group>
      </template>
    </cpro-public>
  </div>
</template>

<script lang="ts" setup>
import cproPublic from '@/components/creat-projects/cpro-public.vue'
import { defineProps, computed } from 'vue'

type propType = {
  chooses: Array<string>
  adaptation: Array<string>
}
const props = defineProps<propType>()
const emit = defineEmits(['UpdateAdaptation'])
const { chooses } = props

const watchCheckBox = computed({
  get(): any {
    return props.adaptation
  },
  set(v: any) {
    emit('UpdateAdaptation', v)
  }
})
</script>

<style lang="less" scoped>
.adaptation {
  margin-left: 12px;
  margin-bottom: 10px;
}
/deep/ .el-checkbox__inner {
  z-index: 0;
}
</style>
